/**
  * Author: Mei
  * Date: 2020-12-03 20:07
  * Description: 
  *
  */
#include <memory>
#include <iostream>
#include <string>

using namespace std;

class Role {
public:
    Role(const string &crole) : role(crole) {
        cout << role << endl;
    }

    ~Role() {
        cout << "delete" << endl;
    }

    void delRole() {
        cout << "delete Role outside" << endl;
    }

private:
    string role;
};

void outdelRole(Role *r) {
    r->delRole();
}

int main() {
    unique_ptr<Role, decltype(outdelRole) *> p1(new Role("trans"), outdelRole);
    return 0;
}